<?php
/**
 * CreateTime: 2023/6/25 14:25
 */

namespace App\Http\Requests\MeLawCase;

use App\Http\Requests\BaseRequests;

class UpdateLatterInfoRequest  extends BaseRequests
{

    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'read_time' => "required",
            'browser' => "required",
            'progress' => "required|numeric|min:0|max:100",
            'duration' => "required",
        ];
    }

    public function messages()
    {
        return [
            'read_time.required' => "浏览时间不能为空",
            'browser.required' => "浏览设备不能为空",
            'progress.required' => "浏览进度不能为空",
            'progress.numeric' => "浏览进度必须是数字",
            'progress.min' => "浏览进度最小为0",
            'progress.max' => "浏览进度最大为100",
            'duration.required' => "浏览时长不能为空",
        ];
    }
}